﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Windows.Forms;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
using QuickClassified.DAO;


namespace QuickClassified.Admin
{
    public partial class myads : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //MessageBox.Show(Request.QueryString["userid"].ToString());
            //string title = Request.QueryString["userid"].ToString();
           // string q1 = "select autos_auto_parts_title as title,autos_auto_parts_price as price,autos_auto_parts_city as city,autos_auto_parts_location as location,autos_auto_parts_datetime as datetime,autos_auto_parts_views as views from ad_autos_auto_parts union";
         //   string q2 = "select autos_boats_ships_title,autos_boats_ships_price,autos_boats_ships_city,autos_boats_ships_location,autos_boats_ships_datetime,autos_boats_ships_views from ad_autos_boats_ships";
            string query = "select autos_auto_parts_title as title,autos_auto_parts_price as price,autos_auto_parts_city as city,autos_auto_parts_location as location,autos_auto_parts_datetime as datetime,autos_auto_parts_views as views ,'ad_autos_auto_parts' as tablename from ad_autos_auto_parts where autos_auto_parts_userid='" + Request.QueryString["userid"].ToString() + "'                      union                                   select autos_boats_ships_title,autos_boats_ships_price,autos_boats_ships_city,autos_boats_ships_location,autos_boats_ships_datetime,autos_boats_ships_views,'ad_autos_boats_ships' from ad_autos_boats_ships where autos_boats_ships_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select autos_car_title,autos_car_price,autos_car_city,autos_car_location,autos_car_datetime,autos_car_views,'ad_autos_car' from ad_autos_car where autos_car_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select autos_heavy_vehicle_title,autos_heavy_vehicle_price,autos_heavy_vehicle_city,autos_heavy_vehicle_location,autos_heavy_vehicle_datetime,autos_heavy_vehicle_views,'ad_autos_heavy_vehicle' from ad_autos_heavy_vehicle where autos_heavy_vehicle_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select autos_motor_vehicle_title,autos_motor_vehicle_price,autos_motor_vehicle_city,autos_motor_vehicle_location,autos_motor_vehicle_datetime,autos_motor_vehicle_views,'ad_autos_motor_vehicle' from ad_autos_motor_vehicle where autos_motor_vehicle_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select autos_other_vehicle_title,autos_other_vehicle_price,autos_other_vehicle_city,autos_other_vehicle_location,autos_other_vehicle_datetime,autos_other_vehicle_views,'ad_autos_other_vehicle' from ad_autos_other_vehicle where autos_other_vehicle_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_computer_institutes_title,education_computer_institutes_price,education_computer_institutes_city,education_computer_institutes_location,education_computer_institutes_datetime,education_computer_institutes_views,'ad_education_computer_institutes' from ad_education_computer_institutes where education_computer_institutes_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_cooking_classes_title,education_cooking_classes_price,education_cooking_classes_city,education_cooking_classes_location,education_cooking_classes_datetime,education_cooking_classes_views,'ad_education_cooking_classes' from ad_education_cooking_classes where education_cooking_classes_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_home_tution_title,education_home_tution_price,education_home_tution_city,education_home_tution_location,education_home_tution_datetime,education_home_tution_views,'ad_education_home_tution' from ad_education_home_tution where education_home_tution_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_launage_academies_title,education_launage_academies_price,education_launage_academies_city,education_launage_academies_location,education_launage_academies_datetime,education_launage_academies_views,'ad_education_launage_academies' from ad_education_launage_academies where education_launage_academies_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_montessori_title,education_montessori_price,education_montessori_city,education_montessori_location,education_montessori_datetime,education_montessori_views,'ad_education_montessori' from ad_education_montessori where education_montessori_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_private_tutors_title,education_private_tutors_price,education_private_tutors_city,education_private_tutors_location,education_private_tutors_datetime,education_private_tutors_views,'ad_education_private_tutors' from ad_education_private_tutors where education_private_tutors_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_schools_title,education_schools_price,education_schools_city,education_schools_location,education_schools_datetime,education_schools_views,'ad_education_schools' from ad_education_schools where education_schools_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_short_courses_title,education_short_courses_price,education_short_courses_city,education_short_courses_location,education_short_courses_datetime,education_short_courses_views,'ad_education_short_courses' from ad_education_short_courses where education_short_courses_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_technical_institute_title,education_technical_institute_price,education_technical_institute_city,education_technical_institute_location,education_technical_institute_datetime,education_technical_institute_views,'ad_education_technical_institute' from ad_education_technical_institute where education_technical_institute_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select elecronics_computer_accessories_title,elecronics_computer_accessories_price,elecronics_computer_accessories_city,elecronics_computer_accessories_location,elecronics_computer_accessories_datetime,elecronics_computer_accessories_views,'ad_elecronics_computer_accessories' from ad_elecronics_computer_accessories where elecronics_computer_accessories_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select electronics_computer_title,electronics_computer_price,electronics_computer_city,electronics_computer_location,electronics_computer_datetime,electronics_computer_views,'ad_electronics_computer' from ad_electronics_computer where electronics_computer_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select electronics_laptops_title,electronics_laptops_price,electronics_laptops_city,electronics_laptops_location,electronics_laptops_datetime,electronics_laptops_views,'ad_electronics_laptops' from ad_electronics_laptops where electronics_laptops_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select electronics_mobile_title,electronics_mobile_price,electronics_mobile_city,electronics_mobile_location,electronics_mobile_datetime,electronics_mobile_views,'ad_electronics_mobile' from ad_electronics_mobile where electronics_mobile_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select electronics_mobile_accessories_title,electronics_mobile_accessories_price,electronics_mobile_accessories_city,electronics_mobile_accessories_location,electronics_mobile_accessories_datetime,electronics_mobile_accessories_views,'ad_electronics_mobile_accessories' from ad_electronics_mobile_accessories where electronics_mobile_accessories_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select electronics_other_electronics_title,electronics_other_electronics_price,electronics_other_electronics_city,electronics_other_electronics_location,electronics_other_electronics_datetime,electronics_other_electronics_views,'ad_electronics_other_electronics' from ad_electronics_other_electronics where electronics_other_electronics_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select electronics_software_title,electronics_software_price,electronics_software_city,electronics_software_location,electronics_software_datetime,electronics_software_views,'ad_electronics_software' from ad_electronics_software where electronics_software_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select events_announcements_title,events_announcements_price,events_announcements_city,events_announcements_location,events_announcements_datetime,events_announcements_views,'ad_events_announcements' from ad_events_announcements where events_announcements_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select events_auctions_title,events_auctions_price,events_auctions_city,events_auctions_location,events_auctions_datetime,events_auctions_views,'ad_events_auctions' from ad_events_auctions where events_auctions_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select events_lots_funds_title,events_lots_funds_price,events_lots_funds_city,events_lots_funds_location,events_lots_funds_datetime,events_lots_funds_views,'ad_events_lots_funds' from ad_events_lots_funds where events_lots_funds_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select events_personals_title,events_personals_price,events_personals_city,events_personals_location,events_personals_datetime,events_personals_views,'ad_events_personals' from ad_events_personals where events_personals_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select events_special_events_occasions_title,events_special_events_occasions_price,events_special_events_occasions_city,events_special_events_occasions_location,events_special_events_occasions_datetime,events_special_events_occasions_views,'ad_events_special_events_occasions' from ad_events_special_events_occasions where events_special_events_occasions_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select events_special_tender_notice_title,events_special_tender_notice_price,events_special_tender_notice_city,events_special_tender_notice_location,events_special_tender_notice_datetime,events_special_tender_notice_views,'ad_events_special_tender_notice' from ad_events_special_tender_notice where events_special_tender_notice_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_air_conditioner_title,home_appliances_air_conditioner_price,home_appliances_air_conditioner_city,home_appliances_air_conditioner_location,home_appliances_air_conditioner_datetime,home_appliances_air_conditioner_views,'ad_home_appliances_air_conditioner' from ad_home_appliances_air_conditioner where home_appliances_air_conditioner_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_fridge_title,home_appliances_fridge_price,home_appliances_fridge_city,home_appliances_fridge_location,home_appliances_fridge_datetime,home_appliances_fridge_views,'ad_home_appliances_fridge' from ad_home_appliances_fridge where home_appliances_fridge_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_furniture_title,home_appliances_furniture_price,home_appliances_furniture_city,home_appliances_furniture_location,home_appliances_furniture_datetime,home_appliances_furniture_views,'ad_home_appliances_furniture' from ad_home_appliances_furniture where home_appliances_furniture_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_other_home_appliances_title,home_appliances_other_home_appliances_price,home_appliances_other_home_appliances_city,home_appliances_other_home_appliances_location,home_appliances_other_home_appliances_datetime,home_appliances_other_home_appliances_views,'ad_home_appliances_other_home_appliances' from ad_home_appliances_other_home_appliances where home_appliances_other_home_appliances_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_tv_title,home_appliances_tv_price,home_appliances_tv_city,home_appliances_tv_location,home_appliances_tv_datetime,home_appliances_tv_views,'ad_home_appliances_tv' from ad_home_appliances_tv where home_appliances_tv_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_vacume_cleaner_title,home_appliances_vacume_cleaner_price,home_appliances_vacume_cleaner_city,home_appliances_vacume_cleaner_location,home_appliances_vacume_cleaner_datetime,home_appliances_vacume_cleaner_views,'ad_home_appliances_vacume_cleaner' from ad_home_appliances_vacume_cleaner where home_appliances_vacume_cleaner_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_water_chiller_title,home_appliances_water_chiller_price,home_appliances_water_chiller_city,home_appliances_water_chiller_loction,home_appliances_water_chiller_datetime,home_appliances_water_chiller_views,'ad_home_appliances_water_chiller' from ad_home_appliances_water_chiller where home_appliances_water_chiller_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select Matrimonial_brides_title,Matrimonial_brides_city,Matrimonial_brides_city,Matrimonial_brides_location,Matrimonial_brides_datetime,Matrimonial_brides_views,'ad_Matrimonial_brides' from ad_Matrimonial_brides where Matrimonial_brides_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select Matrimonial_grooms_title,Matrimonial_grooms_city,Matrimonial_grooms_city,Matrimonial_grooms_location,Matrimonial_grooms_datetime,Matrimonial_grooms_views,'ad_Matrimonial_grooms' from ad_Matrimonial_grooms where Matrimonial_grooms_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_art_crafts_title,miscellaneous_art_crafts_price,miscellaneous_art_crafts_city,miscellaneous_art_crafts_location,miscellaneous_art_crafts_datetime,miscellaneous_art_crafts_views,'ad_miscellaneous_art_crafts' from ad_miscellaneous_art_crafts where miscellaneous_art_crafts_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_book_magazines_title,miscellaneous_book_magazines_price,miscellaneous_book_magazines_city,miscellaneous_book_magazines_location,miscellaneous_book_magazines_datetime,miscellaneous_book_magazines_views,'ad_miscellaneous_book_magazines' from ad_miscellaneous_book_magazines where miscellaneous_book_magazines_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_clothing_title,miscellaneous_clothing_price,miscellaneous_clothing_city,miscellaneous_clothing_location,miscellaneous_clothing_datetime,miscellaneous_clothing_views,'ad_miscellaneous_clothing' from ad_miscellaneous_clothing where miscellaneous_clothing_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_eating_outlets_title,miscellaneous_eating_outlets_price,miscellaneous_eating_outlets_city,miscellaneous_eating_outlets_location,miscellaneous_eating_outlets_datetime,miscellaneous_eating_outlets_views,'ad_miscellaneous_eating_outlets' from ad_miscellaneous_eating_outlets where miscellaneous_eating_outlets_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_guns_title,miscellaneous_guns_price,miscellaneous_guns_city,miscellaneous_guns_location,miscellaneous_guns_datetime,miscellaneous_guns_views,'ad_miscellaneous_guns' from ad_miscellaneous_guns where miscellaneous_guns_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_jewelery_title,miscellaneous_jewelery_price,miscellaneous_jewelery_city,miscellaneous_jewelery_location,miscellaneous_jewelery_datetime,miscellaneous_jewelery_views,'ad_miscellaneous_jewelery' from ad_miscellaneous_jewelery where miscellaneous_jewelery_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_pets_title,miscellaneous_pets_price,miscellaneous_pets_city,miscellaneous_pets_location,miscellaneous_pets_datetime,miscellaneous_pets_views,'ad_miscellaneous_pets' from ad_miscellaneous_pets where miscellaneous_pets_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select real_estate_appartment_title,real_estate_appartment_price,real_estate_appartment_city,real_estate_appartment_location,real_estate_appartment_datetime,real_estate_appartment_views,'ad_real_estate_appartment' from ad_real_estate_appartment where real_estate_appartment_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select real_estate_houses_title,real_estate_houses_price,real_estate_houses_city,real_estate_houses_location,real_estate_houses_datetime,real_estate_houses_views,'ad_real_estate_houses' from ad_real_estate_houses where real_estate_houses_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select real_estate_offices_title,real_estate_offices_price,real_estate_offices_city,real_estate_offices_location,real_estate_offices_datetime,real_estate_offices_views,'ad_real_estate_offices' from ad_real_estate_offices where real_estate_offices_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select real_estate_plots_lands_title,real_estate_plots_lands_price,real_estate_plots_lands_city,real_estate_plots_lands_location,real_estate_plots_lands_datetime,real_estate_plots_lands_views,'ad_real_estate_plots_lands' from ad_real_estate_plots_lands where real_estate_plots_lands_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select real_estate_shops_title,real_estate_shops_price,real_estate_shops_city,real_estate_shops_location,real_estate_shops_datetime,real_estate_shops_views,'ad_real_estate_shops' from ad_real_estate_shops where real_estate_shops_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select services_title,services_price,services_city,services_location,services_datetime,services_views,'ad_services' from ad_services where services_userid='" + Request.QueryString["userid"].ToString() + "'";
      //      string query = q1 + "select autos_boats_ships_title,autos_boats_ships_price,autos_boats_ships_city,autos_boats_ships_location,autos_boats_ships_datetime,autos_boats_ships_views from ad_autos_boats_ships";
            adslistview.DataSource = showuserad(query);
            adslistview.DataBind();

          
            


        }
        public DataTable showuserad(string query)
        {


            SqlConnection connection = Connection_Manger.getConnection();
            SqlCommand command = new SqlCommand(query, connection);
            connection.Open();
            SqlDataAdapter dp = new SqlDataAdapter(command);
            DataTable ds = new DataTable();

            dp.Fill(ds);

            return ds;

        }
        protected void ad_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            //if (e.CommandName == "adscommandtitle")
            //{
            //    // string id = e.CommandArgument.ToString();
            //    MessageBox.Show("this is adscommandtitle command");
            //    //Response.Redirect("Details.aspx?id=" + id + "&tablename=" + tablename);
            //}
            //else if (e.CommandName == "adscommanddelete")
            //{

            //    MessageBox.Show("delete command is selected");
            //    // this.user("delete from aspnet_Membership where UserId= '" + e.CommandArgument.ToString() + "'  ");
            //    //this.user("delete from aspnet_users where UserId= '" + e.CommandArgument.ToString() + "'  ");


            //}
            //else if (e.CommandName == "adscommandedit")
            //{

            //    MessageBox.Show("edit command is selected");
            //    //profilelistview.DataSource = this.showuser("select firstname,lastname,mobile,city,address,country from custom_profile where userid='" + e.CommandArgument.ToString() + "' ");
            //    //profilelistview.DataBind();
            //    //assignroleup.Visible = false;
            //    //profileup.Visible = true;
            //}

            //else if (e.CommandName == "adscommandview")
            //{

            //    // profileup.Visible = false;
            //    //assignroleup.Visible = true;
            //    //userid = e.CommandArgument.ToString() + "is added";
            //    MessageBox.Show("view command is selected");
            //}
        }

        protected void adlistview_PreRender(object sender, EventArgs e)
        {
            adslistview.DataSource = showuserad("select autos_auto_parts_title as title,autos_auto_parts_price as price,autos_auto_parts_city as city,autos_auto_parts_location as location,autos_auto_parts_datetime as datetime,autos_auto_parts_views as views ,'ad_autos_auto_parts' as tablename from ad_autos_auto_parts where autos_auto_parts_userid='" + Request.QueryString["userid"].ToString() + "'                      union                                   select autos_boats_ships_title,autos_boats_ships_price,autos_boats_ships_city,autos_boats_ships_location,autos_boats_ships_datetime,autos_boats_ships_views,'ad_autos_boats_ships' from ad_autos_boats_ships where autos_boats_ships_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select autos_car_title,autos_car_price,autos_car_city,autos_car_location,autos_car_datetime,autos_car_views,'ad_autos_car' from ad_autos_car where autos_car_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select autos_heavy_vehicle_title,autos_heavy_vehicle_price,autos_heavy_vehicle_city,autos_heavy_vehicle_location,autos_heavy_vehicle_datetime,autos_heavy_vehicle_views,'ad_autos_heavy_vehicle' from ad_autos_heavy_vehicle where autos_heavy_vehicle_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select autos_motor_vehicle_title,autos_motor_vehicle_price,autos_motor_vehicle_city,autos_motor_vehicle_location,autos_motor_vehicle_datetime,autos_motor_vehicle_views,'ad_autos_motor_vehicle' from ad_autos_motor_vehicle where autos_motor_vehicle_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select autos_other_vehicle_title,autos_other_vehicle_price,autos_other_vehicle_city,autos_other_vehicle_location,autos_other_vehicle_datetime,autos_other_vehicle_views,'ad_autos_other_vehicle' from ad_autos_other_vehicle where autos_other_vehicle_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_computer_institutes_title,education_computer_institutes_price,education_computer_institutes_city,education_computer_institutes_location,education_computer_institutes_datetime,education_computer_institutes_views,'ad_education_computer_institutes' from ad_education_computer_institutes where education_computer_institutes_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_cooking_classes_title,education_cooking_classes_price,education_cooking_classes_city,education_cooking_classes_location,education_cooking_classes_datetime,education_cooking_classes_views,'ad_education_cooking_classes' from ad_education_cooking_classes where education_cooking_classes_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_home_tution_title,education_home_tution_price,education_home_tution_city,education_home_tution_location,education_home_tution_datetime,education_home_tution_views,'ad_education_home_tution' from ad_education_home_tution where education_home_tution_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_launage_academies_title,education_launage_academies_price,education_launage_academies_city,education_launage_academies_location,education_launage_academies_datetime,education_launage_academies_views,'ad_education_launage_academies' from ad_education_launage_academies where education_launage_academies_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_montessori_title,education_montessori_price,education_montessori_city,education_montessori_location,education_montessori_datetime,education_montessori_views,'ad_education_montessori' from ad_education_montessori where education_montessori_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_private_tutors_title,education_private_tutors_price,education_private_tutors_city,education_private_tutors_location,education_private_tutors_datetime,education_private_tutors_views,'ad_education_private_tutors' from ad_education_private_tutors where education_private_tutors_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_schools_title,education_schools_price,education_schools_city,education_schools_location,education_schools_datetime,education_schools_views,'ad_education_schools' from ad_education_schools where education_schools_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_short_courses_title,education_short_courses_price,education_short_courses_city,education_short_courses_location,education_short_courses_datetime,education_short_courses_views,'ad_education_short_courses' from ad_education_short_courses where education_short_courses_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select education_technical_institute_title,education_technical_institute_price,education_technical_institute_city,education_technical_institute_location,education_technical_institute_datetime,education_technical_institute_views,'ad_education_technical_institute' from ad_education_technical_institute where education_technical_institute_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select elecronics_computer_accessories_title,elecronics_computer_accessories_price,elecronics_computer_accessories_city,elecronics_computer_accessories_location,elecronics_computer_accessories_datetime,elecronics_computer_accessories_views,'ad_elecronics_computer_accessories' from ad_elecronics_computer_accessories where elecronics_computer_accessories_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select electronics_computer_title,electronics_computer_price,electronics_computer_city,electronics_computer_location,electronics_computer_datetime,electronics_computer_views,'ad_electronics_computer' from ad_electronics_computer where electronics_computer_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select electronics_laptops_title,electronics_laptops_price,electronics_laptops_city,electronics_laptops_location,electronics_laptops_datetime,electronics_laptops_views,'ad_electronics_laptops' from ad_electronics_laptops where electronics_laptops_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select electronics_mobile_title,electronics_mobile_price,electronics_mobile_city,electronics_mobile_location,electronics_mobile_datetime,electronics_mobile_views,'ad_electronics_mobile' from ad_electronics_mobile where electronics_mobile_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select electronics_mobile_accessories_title,electronics_mobile_accessories_price,electronics_mobile_accessories_city,electronics_mobile_accessories_location,electronics_mobile_accessories_datetime,electronics_mobile_accessories_views,'ad_electronics_mobile_accessories' from ad_electronics_mobile_accessories where electronics_mobile_accessories_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select electronics_other_electronics_title,electronics_other_electronics_price,electronics_other_electronics_city,electronics_other_electronics_location,electronics_other_electronics_datetime,electronics_other_electronics_views,'ad_electronics_other_electronics' from ad_electronics_other_electronics where electronics_other_electronics_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select electronics_software_title,electronics_software_price,electronics_software_city,electronics_software_location,electronics_software_datetime,electronics_software_views,'ad_electronics_software' from ad_electronics_software where electronics_software_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select events_announcements_title,events_announcements_price,events_announcements_city,events_announcements_location,events_announcements_datetime,events_announcements_views,'ad_events_announcements' from ad_events_announcements where events_announcements_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select events_auctions_title,events_auctions_price,events_auctions_city,events_auctions_location,events_auctions_datetime,events_auctions_views,'ad_events_auctions' from ad_events_auctions where events_auctions_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select events_lots_funds_title,events_lots_funds_price,events_lots_funds_city,events_lots_funds_location,events_lots_funds_datetime,events_lots_funds_views,'ad_events_lots_funds' from ad_events_lots_funds where events_lots_funds_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select events_personals_title,events_personals_price,events_personals_city,events_personals_location,events_personals_datetime,events_personals_views,'ad_events_personals' from ad_events_personals where events_personals_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select events_special_events_occasions_title,events_special_events_occasions_price,events_special_events_occasions_city,events_special_events_occasions_location,events_special_events_occasions_datetime,events_special_events_occasions_views,'ad_events_special_events_occasions' from ad_events_special_events_occasions where events_special_events_occasions_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select events_special_tender_notice_title,events_special_tender_notice_price,events_special_tender_notice_city,events_special_tender_notice_location,events_special_tender_notice_datetime,events_special_tender_notice_views,'ad_events_special_tender_notice' from ad_events_special_tender_notice where events_special_tender_notice_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_air_conditioner_title,home_appliances_air_conditioner_price,home_appliances_air_conditioner_city,home_appliances_air_conditioner_location,home_appliances_air_conditioner_datetime,home_appliances_air_conditioner_views,'ad_home_appliances_air_conditioner' from ad_home_appliances_air_conditioner where home_appliances_air_conditioner_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_fridge_title,home_appliances_fridge_price,home_appliances_fridge_city,home_appliances_fridge_location,home_appliances_fridge_datetime,home_appliances_fridge_views,'ad_home_appliances_fridge' from ad_home_appliances_fridge where home_appliances_fridge_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_furniture_title,home_appliances_furniture_price,home_appliances_furniture_city,home_appliances_furniture_location,home_appliances_furniture_datetime,home_appliances_furniture_views,'ad_home_appliances_furniture' from ad_home_appliances_furniture where home_appliances_furniture_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_other_home_appliances_title,home_appliances_other_home_appliances_price,home_appliances_other_home_appliances_city,home_appliances_other_home_appliances_location,home_appliances_other_home_appliances_datetime,home_appliances_other_home_appliances_views,'ad_home_appliances_other_home_appliances' from ad_home_appliances_other_home_appliances where home_appliances_other_home_appliances_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_tv_title,home_appliances_tv_price,home_appliances_tv_city,home_appliances_tv_location,home_appliances_tv_datetime,home_appliances_tv_views,'ad_home_appliances_tv' from ad_home_appliances_tv where home_appliances_tv_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_vacume_cleaner_title,home_appliances_vacume_cleaner_price,home_appliances_vacume_cleaner_city,home_appliances_vacume_cleaner_location,home_appliances_vacume_cleaner_datetime,home_appliances_vacume_cleaner_views,'ad_home_appliances_vacume_cleaner' from ad_home_appliances_vacume_cleaner where home_appliances_vacume_cleaner_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select home_appliances_water_chiller_title,home_appliances_water_chiller_price,home_appliances_water_chiller_city,home_appliances_water_chiller_loction,home_appliances_water_chiller_datetime,home_appliances_water_chiller_views,'ad_home_appliances_water_chiller' from ad_home_appliances_water_chiller where home_appliances_water_chiller_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select Matrimonial_brides_title,Matrimonial_brides_city,Matrimonial_brides_city,Matrimonial_brides_location,Matrimonial_brides_datetime,Matrimonial_brides_views,'ad_Matrimonial_brides' from ad_Matrimonial_brides where Matrimonial_brides_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select Matrimonial_grooms_title,Matrimonial_grooms_city,Matrimonial_grooms_city,Matrimonial_grooms_location,Matrimonial_grooms_datetime,Matrimonial_grooms_views,'ad_Matrimonial_grooms' from ad_Matrimonial_grooms where Matrimonial_grooms_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_art_crafts_title,miscellaneous_art_crafts_price,miscellaneous_art_crafts_city,miscellaneous_art_crafts_location,miscellaneous_art_crafts_datetime,miscellaneous_art_crafts_views,'ad_miscellaneous_art_crafts' from ad_miscellaneous_art_crafts where miscellaneous_art_crafts_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_book_magazines_title,miscellaneous_book_magazines_price,miscellaneous_book_magazines_city,miscellaneous_book_magazines_location,miscellaneous_book_magazines_datetime,miscellaneous_book_magazines_views,'ad_miscellaneous_book_magazines' from ad_miscellaneous_book_magazines where miscellaneous_book_magazines_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_clothing_title,miscellaneous_clothing_price,miscellaneous_clothing_city,miscellaneous_clothing_location,miscellaneous_clothing_datetime,miscellaneous_clothing_views,'ad_miscellaneous_clothing' from ad_miscellaneous_clothing where miscellaneous_clothing_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_eating_outlets_title,miscellaneous_eating_outlets_price,miscellaneous_eating_outlets_city,miscellaneous_eating_outlets_location,miscellaneous_eating_outlets_datetime,miscellaneous_eating_outlets_views,'ad_miscellaneous_eating_outlets' from ad_miscellaneous_eating_outlets where miscellaneous_eating_outlets_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_guns_title,miscellaneous_guns_price,miscellaneous_guns_city,miscellaneous_guns_location,miscellaneous_guns_datetime,miscellaneous_guns_views,'ad_miscellaneous_guns' from ad_miscellaneous_guns where miscellaneous_guns_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_jewelery_title,miscellaneous_jewelery_price,miscellaneous_jewelery_city,miscellaneous_jewelery_location,miscellaneous_jewelery_datetime,miscellaneous_jewelery_views,'ad_miscellaneous_jewelery' from ad_miscellaneous_jewelery where miscellaneous_jewelery_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select miscellaneous_pets_title,miscellaneous_pets_price,miscellaneous_pets_city,miscellaneous_pets_location,miscellaneous_pets_datetime,miscellaneous_pets_views,'ad_miscellaneous_pets' from ad_miscellaneous_pets where miscellaneous_pets_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select real_estate_appartment_title,real_estate_appartment_price,real_estate_appartment_city,real_estate_appartment_location,real_estate_appartment_datetime,real_estate_appartment_views,'ad_real_estate_appartment' from ad_real_estate_appartment where real_estate_appartment_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select real_estate_houses_title,real_estate_houses_price,real_estate_houses_city,real_estate_houses_location,real_estate_houses_datetime,real_estate_houses_views,'ad_real_estate_houses' from ad_real_estate_houses where real_estate_houses_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select real_estate_offices_title,real_estate_offices_price,real_estate_offices_city,real_estate_offices_location,real_estate_offices_datetime,real_estate_offices_views,'ad_real_estate_offices' from ad_real_estate_offices where real_estate_offices_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select real_estate_plots_lands_title,real_estate_plots_lands_price,real_estate_plots_lands_city,real_estate_plots_lands_location,real_estate_plots_lands_datetime,real_estate_plots_lands_views,'ad_real_estate_plots_lands' from ad_real_estate_plots_lands where real_estate_plots_lands_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select real_estate_shops_title,real_estate_shops_price,real_estate_shops_city,real_estate_shops_location,real_estate_shops_datetime,real_estate_shops_views,'ad_real_estate_shops' from ad_real_estate_shops where real_estate_shops_userid='" + Request.QueryString["userid"].ToString() + "'                            union                                    select services_title,services_price,services_city,services_location,services_datetime,services_views,'ad_services' from ad_services where services_userid='" + Request.QueryString["userid"].ToString() + "'");
            adslistview.DataBind();
        }

    }
}